package b59;

public class Main22 {
    public static void main(String[] args) {
        System.out.println(get(1));
    }

    static String get(int num) {
        int i = 1;
        while(true) {
            if(num >= Math.pow(i,2)+1) {
                num = num - (int)(Math.pow(i,2)+1);
                i++;
            }else{
                break;
            }
        }
        return i-1+" "+num;
    }
}
